﻿using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(Debuger))]
public class DebugSetingInspector :Editor {
	Debuger _target;
	public void OnEnable(){
		if(_target == null){
			_target = target as Debuger;
		}
	}
	public override void OnInspectorGUI ()
	{
		int count = (int)DebugType.DebufCount;
		if(_target.data == null || _target.data.Length != count){
			_target.Rest();
		}
		_target.enable = EditorGUILayout.Toggle("激活:",_target.enable);
		_target.logGameTime = EditorGUILayout.Toggle("打印游戏时间:",_target.logGameTime);
		_target.logStack = EditorGUILayout.Toggle("打印调用函数:",_target.logStack);
		_target.logField = EditorGUILayout.Toggle("打印调用成员:",_target.logField);
		EditorGUILayout.Space();
		for(int i = 0;i < count;i++){
			_target.data[i].debugEnable = EditorGUILayout.Toggle(_target.data[i].debugName,_target.data[i].debugEnable);
		}
	}
}
